﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using Tilver.DBConnectionUI;

namespace Tilver.DBConnectionUI.Firebird
{
    internal class FirebirdStringBuilder: UDLStringBuilder
    {
        public FirebirdStringBuilder()
        {
            Dialect = 3;
            Port = 3050;
            Charset = "NONE";
            PacketSize = 8192;
            ConnectionLifetime = 0;
            ConnectionTimeout = 15;
            MinPoolSize = 0;
            MaxPoolSize = 100;
            Pooling = true;
            FetchSize = 200;
            ServerType = 0;
            RecordsAffected = true;

            RegisterAlias("Server", "Data Source");
        }

        public string Database { get; set; }
        public string User { get; set; }
        public string Password { get; set; }
        [DefaultValue(3)]
        public int Dialect { get; set; }
        [DisplayName("Data Source")]
        public string DataSource { get; set; }
        [DefaultValue(3050)]
        public int Port { get; set; }
        [DefaultValue("NONE")]
        public string Charset { get; set; }
        public string Role { get; set; }
        [DefaultValue(8192),DisplayName("Packet Size")]
        public int PacketSize { get; set; }
        [DefaultValue(0),DisplayName("Connection Lifetime")]
        public int ConnectionLifetime { get; set; }
        [DefaultValue(15), DisplayName("Connection Timeout")]
        public int ConnectionTimeout { get; set; }
        [DefaultValue(0)]
        public int MinPoolSize { get; set; }
        [DefaultValue(100)]
        public int MaxPoolSize { get; set; }
        [DefaultValue(true)]
        public bool Pooling { get; set; }
        [DefaultValue(200),DisplayName("Fetch Size")]
        public int FetchSize { get; set; }
        [DefaultValue(0)]
        public int ServerType { get; set; }
        [DefaultValue(true),DisplayName("Records Affected")]
        public bool RecordsAffected { get; set; }
        [DisplayName("Context Connection")]
        public bool ContextConnection { get; set; }

    }
}
